package models;

import java.sql.ResultSet;
import java.sql.SQLException;

public class CustomerModel extends AbstractModel {
	public boolean insert(String cid, String password, String name,
			String address, String phone) {
		try {
			ps = con.prepareStatement("INSERT INTO Customer VALUES (?,?,?,?,?)");

			ps.setString(1, cid);
			ps.setString(2, password);
			ps.setString(3, name);
			ps.setString(4, address);
			ps.setString(5, phone);

			return wrapUp();
		} catch (SQLException ex) {
			return registerException(ex);
		}
	}

	public boolean delete(String cid) {
		try {
			ps = con.prepareStatement("DELETE FROM Customer WHERE cid = ?");
			ps.setString(1, cid);

			return wrapUp();
		} catch (SQLException ex) {
			return registerException(ex);
		}
	}

	public ResultSet show() {
		return super.show("Customer");
	}
}